import Vue from 'vue'
import VueRouter from 'vue-router'
import { Tabbar, TabbarItem } from 'vant';

Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: ()=> import('@/views/Main/main'),
    redirect: "/home",
    children: [
      {
        path: '/home',
        component: ()=> import('@/views/Main/Home'),
      },
      {
        path: '/shop',
        component: ()=> import('@/views/Main/Shop'),
      },
      {
        path: '/live',
        component: ()=> import('@/views/Main/Live'),
      },
    ]
  },
  {
    path: '/search',
    component: ()=> import('@/views/Search/search.vue'),
  },
  {
    path: '/self',
    component: ()=> import('@/views/Self'),
  },
  {
    path: '/category',
    component: ()=> import('@/views/Category/category.vue'),
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
